﻿using System;
using System.ServiceModel;
using System.Security.Permissions;
using Sinacor.Infra.Service.Security.Services;
using Sinacor.Infra.Common.Exceptions;
using Sinacor.Infra.Service.ExceptionHandling;
using System.Collections.Generic;


namespace Sinacor.Servico.Bovespa.Ordens.Service.ServiceContract
{
    [ExceptionShielding]
    [ServiceContract(Namespace = "http://www.bovespa.com.br/Sinacor.Servico.Bovespa.Ordens.Service.ServiceContract", SessionMode = SessionMode.Allowed)]
    public interface ILoteOrdem
    {
        /// <summary>
        /// Operacao responsavel por Criar um Objeto LoteOrdem
        /// </summary>
        /// <param name="request">colecao de DAtaContract de LoteOrdem</param>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "CriarLoteOrdem")]        
        [OperationLog]
        [TransactionRequired]
        int CriarLoteOrdem(List<DataContract.Request.LoteOrdemRequest> request);
        
        /// <summary>
        /// Operacao responsavel por Trocar um Objeto LoteOrdem
        /// </summary>
        /// <param name="request">colecao de DataContract de LoteOrdem</param>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action = "TrocarLoteOrdem")]
        [OperationLog]
        [TransactionRequired]
        bool TrocarLoteOrdem(List<DataContract.Request.LoteOrdemRequest> request);


        /// <summary>
        /// Operacao responsavel por consultar um Lote Vinculado
        /// WAbreu.7COMm - 17/07/2008
        /// </summary>
        /// <param name="pRequest">ConsultarLoteVinculadoRequest</param>
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.BusinessFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.ValidationFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.GeneralFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.InvalidSessionFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.LicensingFault))]
        [FaultContract(typeof(Sinacor.Infra.Common.Exceptions.FaultContracts.AccessIsDeniedFault))] 
        [OperationContract(IsTerminating = false, IsInitiating = true, IsOneWay = false, AsyncPattern = false, Action="ConsultarLoteVinculado")]
        List<DataContract.Response.LoteOrdemResponse> ConsultarLoteVinculado(DataContract.Request.ConsultarLoteVinculadoRequest pRequest);
    }
}
